Always respect `CARGO_TARGET_DIR` during `cargo install`
authorJustin Geibel <jtgeibel@gmail.com>
Fri, 22 Dec 2017 01:14:12 +0000 (20:14 -0500)
committerJustin Geibel <jtgeibel@gmail.com>
Fri, 22 Dec 2017 05:27:29 +0000 (00:27 -0500)
commita81b1437de95920618119272c7a92bab9974ee30
tree14592182261ffa26ca2a61a91091138e11fd6b8d
parentfac7e2559a5ceebcf3e710e2076f9ca3df9ab465
Always respect `CARGO_TARGET_DIR` during `cargo install`

This aligns the behavior of crates.io and `--git` sources with that of `--path`
regarding the `CARGO_TARGET_DIR` and `CARGO_BUILD_TARGET_DIR` environment
variables.  If neither environment variable is set, then a temporary directory
is still used when installing from crates.io or `--git`.

As discussed in #4725, this can be used to enable caching of artifacts between
continuous integration builds.
src/bin/install.rs
src/cargo/ops/cargo_install.rs
src/etc/man/cargo-install.1
tests/install.rs